package com.xinqi.modules.prepare.common.utils;

import com.xinqi.common.base.dto.CommonFileDTO;
import com.xinqi.modules.prepare.folder.domain.PrepareFileFolderEntity;

import java.util.List;

/**
 * @author linkai
 * @date 2023/3/24
 */
public interface CommonFileUtils {

    static Long fileSize(List<CommonFileDTO> files) {
        return com.xinqi.common.base.dto.utils.CommonFileUtils.fileSize(files);
    }

    static List<CommonFileDTO> toFileObj(String json) {
        return com.xinqi.common.base.dto.utils.CommonFileUtils.toFileObj(json);
    }

    static int fileLevel(String filePath) {
        return com.xinqi.common.base.dto.utils.CommonFileUtils.fileLevel(filePath);
    }

    static String filePath(String fileName) {
        return com.xinqi.common.base.dto.utils.CommonFileUtils.filePath(fileName);
    }

    static String filePath(String fileName, PrepareFileFolderEntity parentPath) {
        return filePath(fileName, parentPath == null ? null : parentPath.getFilePath());
    }

    static String filePath(String fileName, String parentPath) {
        return com.xinqi.common.base.dto.utils.CommonFileUtils.filePath(fileName, parentPath);
    }
}
